<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<title>nih: mtrand/mtrand.h Source File</title>

<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { searchBox.OnSelectItem(0); });
</script>

</head>
<body>
<div id="top"><!-- do not remove this div! -->


<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  
  
  <td style="padding-left: 0.5em;">
   <div id="projectname">nih
   &#160;<span id="projectnumber">0.5</span>
   </div>
   
  </td>
  
  
  
 </tr>
 </tbody>
</table>
</div>

<!-- Generated by Doxygen 1.7.5.1 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="modules.html"><span>Modules</span></a></li>
      <li><a href="annotated.html"><span>Classes</span></a></li>
      <li class="current"><a href="files.html"><span>Files</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="files.html"><span>File&#160;List</span></a></li>
    </ul>
  </div>
</div>
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
  initNavTree('mtrand_8h.html','');
</script>
<div id="doc-content">
<div class="header">
  <div class="headertitle">
<div class="title">mtrand/mtrand.h</div>  </div>
</div>
<div class="contents">
<div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">// mtrand.h</span>
<a name="l00002"></a>00002 <span class="comment">// C++ include file for MT19937, with initialization improved 2002/1/26.</span>
<a name="l00003"></a>00003 <span class="comment">// Coded by Takuji Nishimura and Makoto Matsumoto.</span>
<a name="l00004"></a>00004 <span class="comment">// Ported to C++ by Jasper Bedaux 2003/1/1 (see http://www.bedaux.net/mtrand/).</span>
<a name="l00005"></a>00005 <span class="comment">// The generators returning floating point numbers are based on</span>
<a name="l00006"></a>00006 <span class="comment">// a version by Isaku Wada, 2002/01/09</span>
<a name="l00007"></a>00007 <span class="comment">//</span>
<a name="l00008"></a>00008 <span class="comment">// Copyright (C) 1997 - 2002, Makoto Matsumoto and Takuji Nishimura,</span>
<a name="l00009"></a>00009 <span class="comment">// All rights reserved.</span>
<a name="l00010"></a>00010 <span class="comment">//</span>
<a name="l00011"></a>00011 <span class="comment">// Redistribution and use in source and binary forms, with or without</span>
<a name="l00012"></a>00012 <span class="comment">// modification, are permitted provided that the following conditions</span>
<a name="l00013"></a>00013 <span class="comment">// are met:</span>
<a name="l00014"></a>00014 <span class="comment">//</span>
<a name="l00015"></a>00015 <span class="comment">// 1. Redistributions of source code must retain the above copyright</span>
<a name="l00016"></a>00016 <span class="comment">//    notice, this list of conditions and the following disclaimer.</span>
<a name="l00017"></a>00017 <span class="comment">//</span>
<a name="l00018"></a>00018 <span class="comment">// 2. Redistributions in binary form must reproduce the above copyright</span>
<a name="l00019"></a>00019 <span class="comment">//    notice, this list of conditions and the following disclaimer in the</span>
<a name="l00020"></a>00020 <span class="comment">//    documentation and/or other materials provided with the distribution.</span>
<a name="l00021"></a>00021 <span class="comment">//</span>
<a name="l00022"></a>00022 <span class="comment">// 3. The names of its contributors may not be used to endorse or promote</span>
<a name="l00023"></a>00023 <span class="comment">//    products derived from this software without specific prior written</span>
<a name="l00024"></a>00024 <span class="comment">//    permission.</span>
<a name="l00025"></a>00025 <span class="comment">//</span>
<a name="l00026"></a>00026 <span class="comment">// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS</span>
<a name="l00027"></a>00027 <span class="comment">// &quot;AS IS&quot; AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT</span>
<a name="l00028"></a>00028 <span class="comment">// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR</span>
<a name="l00029"></a>00029 <span class="comment">// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR</span>
<a name="l00030"></a>00030 <span class="comment">// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,</span>
<a name="l00031"></a>00031 <span class="comment">// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,</span>
<a name="l00032"></a>00032 <span class="comment">// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR</span>
<a name="l00033"></a>00033 <span class="comment">// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF</span>
<a name="l00034"></a>00034 <span class="comment">// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING</span>
<a name="l00035"></a>00035 <span class="comment">// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS</span>
<a name="l00036"></a>00036 <span class="comment">// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.</span>
<a name="l00037"></a>00037 <span class="comment">//</span>
<a name="l00038"></a>00038 <span class="comment">// Any feedback is very welcome.</span>
<a name="l00039"></a>00039 <span class="comment">// http://www.math.keio.ac.jp/matumoto/emt.html</span>
<a name="l00040"></a>00040 <span class="comment">// email: matumoto@math.keio.ac.jp</span>
<a name="l00041"></a>00041 <span class="comment">//</span>
<a name="l00042"></a>00042 <span class="comment">// Feedback about the C++ port should be sent to Jasper Bedaux,</span>
<a name="l00043"></a>00043 <span class="comment">// see http://www.bedaux.net/mtrand/ for e-mail address and info.</span>
<a name="l00044"></a>00044 
<a name="l00045"></a>00045 <span class="preprocessor">#ifndef MTRAND_H</span>
<a name="l00046"></a>00046 <span class="preprocessor"></span><span class="preprocessor">#define MTRAND_H</span>
<a name="l00047"></a>00047 <span class="preprocessor"></span>
<a name="l00048"></a>00048 <span class="keyword">namespace </span>mtrand {
<a name="l00049"></a>00049         <span class="keyword">static</span> <span class="keyword">const</span> <span class="keywordtype">char</span> copyright[] = <span class="stringliteral">&quot;Mersenne Twister implementation Copyright (C) 1997 - 2002, Makoto Matsumoto and Takuji Nishimura, All rights reserved.&quot;</span>;
<a name="l00050"></a>00050 }
<a name="l00051"></a>00051 
<a name="l00052"></a><a class="code" href="class_m_t_rand__int32.html">00052</a> <span class="keyword">class </span><a class="code" href="class_m_t_rand__int32.html">MTRand_int32</a> { <span class="comment">// Mersenne Twister random number generator</span>
<a name="l00053"></a>00053 <span class="keyword">public</span>:
<a name="l00054"></a>00054 <span class="comment">// default constructor: uses default seed only if this is the first instance</span>
<a name="l00055"></a>00055   <a class="code" href="class_m_t_rand__int32.html">MTRand_int32</a>() { <span class="keywordflow">if</span> (!init) seed(5489UL); init = <span class="keyword">true</span>; }
<a name="l00056"></a>00056 <span class="comment">// constructor with 32 bit int as seed</span>
<a name="l00057"></a>00057   <a class="code" href="class_m_t_rand__int32.html">MTRand_int32</a>(<span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> s) { seed(s); init = <span class="keyword">true</span>; }
<a name="l00058"></a>00058 <span class="comment">// constructor with array of size 32 bit ints as seed</span>
<a name="l00059"></a>00059   <a class="code" href="class_m_t_rand__int32.html">MTRand_int32</a>(<span class="keyword">const</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span>* array, <span class="keywordtype">int</span> size) { seed(array, size); init = <span class="keyword">true</span>; }
<a name="l00060"></a>00060 <span class="comment">// the two seed functions</span>
<a name="l00061"></a>00061   <span class="keywordtype">void</span> seed(<span class="keywordtype">unsigned</span> <span class="keywordtype">long</span>); <span class="comment">// seed with 32 bit integer</span>
<a name="l00062"></a>00062   <span class="keywordtype">void</span> seed(<span class="keyword">const</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span>*, <span class="keywordtype">int</span> size); <span class="comment">// seed with array</span>
<a name="l00063"></a>00063 <span class="comment">// overload operator() to make this a generator (functor)</span>
<a name="l00064"></a>00064   <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> operator()() { <span class="keywordflow">return</span> rand_int32(); }
<a name="l00065"></a>00065 <span class="comment">// 2007-02-11: made the destructor virtual; thanks &quot;double more&quot; for pointing this out</span>
<a name="l00066"></a>00066   <span class="keyword">virtual</span> ~<a class="code" href="class_m_t_rand__int32.html">MTRand_int32</a>() {} <span class="comment">// destructor</span>
<a name="l00067"></a>00067 <span class="keyword">protected</span>: <span class="comment">// used by derived classes, otherwise not accessible; use the ()-operator</span>
<a name="l00068"></a>00068   <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> rand_int32(); <span class="comment">// generate 32 bit random integer</span>
<a name="l00069"></a>00069 <span class="keyword">private</span>:
<a name="l00070"></a>00070   <span class="keyword">static</span> <span class="keyword">const</span> <span class="keywordtype">int</span> n = 624, m = 397; <span class="comment">// compile time constants</span>
<a name="l00071"></a>00071 <span class="comment">// the variables below are static (no duplicates can exist)</span>
<a name="l00072"></a>00072   <span class="keyword">static</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> state[n]; <span class="comment">// state vector array</span>
<a name="l00073"></a>00073   <span class="keyword">static</span> <span class="keywordtype">int</span> p; <span class="comment">// position in state array</span>
<a name="l00074"></a>00074   <span class="keyword">static</span> <span class="keywordtype">bool</span> init; <span class="comment">// true if init function is called</span>
<a name="l00075"></a>00075 <span class="comment">// private functions used to generate the pseudo random numbers</span>
<a name="l00076"></a>00076   <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> twiddle(<span class="keywordtype">unsigned</span> <span class="keywordtype">long</span>, <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span>); <span class="comment">// used by gen_state()</span>
<a name="l00077"></a>00077   <span class="keywordtype">void</span> gen_state(); <span class="comment">// generate new state</span>
<a name="l00078"></a>00078 <span class="comment">// make copy constructor and assignment operator unavailable, they don&#39;t make sense</span>
<a name="l00079"></a>00079   <a class="code" href="class_m_t_rand__int32.html">MTRand_int32</a>(<span class="keyword">const</span> <a class="code" href="class_m_t_rand__int32.html">MTRand_int32</a>&amp;); <span class="comment">// copy constructor not defined</span>
<a name="l00080"></a>00080   <span class="keywordtype">void</span> operator=(<span class="keyword">const</span> <a class="code" href="class_m_t_rand__int32.html">MTRand_int32</a>&amp;); <span class="comment">// assignment operator not defined</span>
<a name="l00081"></a>00081 };
<a name="l00082"></a>00082 
<a name="l00083"></a>00083 <span class="comment">// inline for speed, must therefore reside in header file</span>
<a name="l00084"></a>00084 <span class="keyword">inline</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> MTRand_int32::twiddle(<span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> u, <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> v) {
<a name="l00085"></a>00085   <span class="keywordflow">return</span> (((u &amp; 0x80000000UL) | (v &amp; 0x7FFFFFFFUL)) &gt;&gt; 1)
<a name="l00086"></a>00086     ^ ((v &amp; 1UL) ? 0x9908B0DFUL : 0x0UL);
<a name="l00087"></a>00087 }
<a name="l00088"></a>00088 
<a name="l00089"></a>00089 <span class="keyword">inline</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> MTRand_int32::rand_int32() { <span class="comment">// generate 32 bit random int</span>
<a name="l00090"></a>00090   <span class="keywordflow">if</span> (p == n) gen_state(); <span class="comment">// new state vector needed</span>
<a name="l00091"></a>00091 <span class="comment">// gen_state() is split off to be non-inline, because it is only called once</span>
<a name="l00092"></a>00092 <span class="comment">// in every 624 calls and otherwise irand() would become too big to get inlined</span>
<a name="l00093"></a>00093   <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> x = state[p++];
<a name="l00094"></a>00094   x ^= (x &gt;&gt; 11);
<a name="l00095"></a>00095   x ^= (x &lt;&lt; 7) &amp; 0x9D2C5680UL;
<a name="l00096"></a>00096   x ^= (x &lt;&lt; 15) &amp; 0xEFC60000UL;
<a name="l00097"></a>00097   <span class="keywordflow">return</span> x ^ (x &gt;&gt; 18);
<a name="l00098"></a>00098 }
<a name="l00099"></a>00099 
<a name="l00100"></a>00100 <span class="comment">// generates double floating point numbers in the half-open interval [0, 1)</span>
<a name="l00101"></a><a class="code" href="class_m_t_rand.html">00101</a> <span class="keyword">class </span><a class="code" href="class_m_t_rand.html">MTRand</a> : <span class="keyword">public</span> <a class="code" href="class_m_t_rand__int32.html">MTRand_int32</a> {
<a name="l00102"></a>00102 <span class="keyword">public</span>:
<a name="l00103"></a>00103   <a class="code" href="class_m_t_rand.html">MTRand</a>() : <a class="code" href="class_m_t_rand__int32.html">MTRand_int32</a>() {}
<a name="l00104"></a>00104   <a class="code" href="class_m_t_rand.html">MTRand</a>(<span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> seed) : <a class="code" href="class_m_t_rand__int32.html">MTRand_int32</a>(seed) {}
<a name="l00105"></a>00105   <a class="code" href="class_m_t_rand.html">MTRand</a>(<span class="keyword">const</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span>* seed, <span class="keywordtype">int</span> size) : <a class="code" href="class_m_t_rand__int32.html">MTRand_int32</a>(seed, size) {}
<a name="l00106"></a>00106   ~<a class="code" href="class_m_t_rand.html">MTRand</a>() {}
<a name="l00107"></a>00107   <span class="keywordtype">double</span> operator()() {
<a name="l00108"></a>00108     <span class="keywordflow">return</span> <span class="keyword">static_cast&lt;</span><span class="keywordtype">double</span><span class="keyword">&gt;</span>(rand_int32()) * (1. / 4294967296.); } <span class="comment">// divided by 2^32</span>
<a name="l00109"></a>00109 <span class="keyword">private</span>:
<a name="l00110"></a>00110   <a class="code" href="class_m_t_rand.html">MTRand</a>(<span class="keyword">const</span> <a class="code" href="class_m_t_rand.html">MTRand</a>&amp;); <span class="comment">// copy constructor not defined</span>
<a name="l00111"></a>00111   <span class="keywordtype">void</span> operator=(<span class="keyword">const</span> <a class="code" href="class_m_t_rand.html">MTRand</a>&amp;); <span class="comment">// assignment operator not defined</span>
<a name="l00112"></a>00112 };
<a name="l00113"></a>00113 
<a name="l00114"></a>00114 <span class="comment">// generates double floating point numbers in the closed interval [0, 1]</span>
<a name="l00115"></a><a class="code" href="class_m_t_rand__closed.html">00115</a> <span class="keyword">class </span><a class="code" href="class_m_t_rand__closed.html">MTRand_closed</a> : <span class="keyword">public</span> <a class="code" href="class_m_t_rand__int32.html">MTRand_int32</a> {
<a name="l00116"></a>00116 <span class="keyword">public</span>:
<a name="l00117"></a>00117   <a class="code" href="class_m_t_rand__closed.html">MTRand_closed</a>() : <a class="code" href="class_m_t_rand__int32.html">MTRand_int32</a>() {}
<a name="l00118"></a>00118   <a class="code" href="class_m_t_rand__closed.html">MTRand_closed</a>(<span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> seed) : <a class="code" href="class_m_t_rand__int32.html">MTRand_int32</a>(seed) {}
<a name="l00119"></a>00119   <a class="code" href="class_m_t_rand__closed.html">MTRand_closed</a>(<span class="keyword">const</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span>* seed, <span class="keywordtype">int</span> size) : <a class="code" href="class_m_t_rand__int32.html">MTRand_int32</a>(seed, size) {}
<a name="l00120"></a>00120   ~<a class="code" href="class_m_t_rand__closed.html">MTRand_closed</a>() {}
<a name="l00121"></a>00121   <span class="keywordtype">double</span> operator()() {
<a name="l00122"></a>00122     <span class="keywordflow">return</span> <span class="keyword">static_cast&lt;</span><span class="keywordtype">double</span><span class="keyword">&gt;</span>(rand_int32()) * (1. / 4294967295.); } <span class="comment">// divided by 2^32 - 1</span>
<a name="l00123"></a>00123 <span class="keyword">private</span>:
<a name="l00124"></a>00124   <a class="code" href="class_m_t_rand__closed.html">MTRand_closed</a>(<span class="keyword">const</span> <a class="code" href="class_m_t_rand__closed.html">MTRand_closed</a>&amp;); <span class="comment">// copy constructor not defined</span>
<a name="l00125"></a>00125   <span class="keywordtype">void</span> operator=(<span class="keyword">const</span> <a class="code" href="class_m_t_rand__closed.html">MTRand_closed</a>&amp;); <span class="comment">// assignment operator not defined</span>
<a name="l00126"></a>00126 };
<a name="l00127"></a>00127 
<a name="l00128"></a>00128 <span class="comment">// generates double floating point numbers in the open interval (0, 1)</span>
<a name="l00129"></a><a class="code" href="class_m_t_rand__open.html">00129</a> <span class="keyword">class </span><a class="code" href="class_m_t_rand__open.html">MTRand_open</a> : <span class="keyword">public</span> <a class="code" href="class_m_t_rand__int32.html">MTRand_int32</a> {
<a name="l00130"></a>00130 <span class="keyword">public</span>:
<a name="l00131"></a>00131   <a class="code" href="class_m_t_rand__open.html">MTRand_open</a>() : <a class="code" href="class_m_t_rand__int32.html">MTRand_int32</a>() {}
<a name="l00132"></a>00132   <a class="code" href="class_m_t_rand__open.html">MTRand_open</a>(<span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> seed) : <a class="code" href="class_m_t_rand__int32.html">MTRand_int32</a>(seed) {}
<a name="l00133"></a>00133   <a class="code" href="class_m_t_rand__open.html">MTRand_open</a>(<span class="keyword">const</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span>* seed, <span class="keywordtype">int</span> size) : <a class="code" href="class_m_t_rand__int32.html">MTRand_int32</a>(seed, size) {}
<a name="l00134"></a>00134   ~<a class="code" href="class_m_t_rand__open.html">MTRand_open</a>() {}
<a name="l00135"></a>00135   <span class="keywordtype">double</span> operator()() {
<a name="l00136"></a>00136     <span class="keywordflow">return</span> (static_cast&lt;double&gt;(rand_int32()) + .5) * (1. / 4294967296.); } <span class="comment">// divided by 2^32</span>
<a name="l00137"></a>00137 <span class="keyword">private</span>:
<a name="l00138"></a>00138   <a class="code" href="class_m_t_rand__open.html">MTRand_open</a>(<span class="keyword">const</span> <a class="code" href="class_m_t_rand__open.html">MTRand_open</a>&amp;); <span class="comment">// copy constructor not defined</span>
<a name="l00139"></a>00139   <span class="keywordtype">void</span> operator=(<span class="keyword">const</span> <a class="code" href="class_m_t_rand__open.html">MTRand_open</a>&amp;); <span class="comment">// assignment operator not defined</span>
<a name="l00140"></a>00140 };
<a name="l00141"></a>00141 
<a name="l00142"></a>00142 <span class="comment">// generates 53 bit resolution doubles in the half-open interval [0, 1)</span>
<a name="l00143"></a><a class="code" href="class_m_t_rand53.html">00143</a> <span class="keyword">class </span><a class="code" href="class_m_t_rand53.html">MTRand53</a> : <span class="keyword">public</span> <a class="code" href="class_m_t_rand__int32.html">MTRand_int32</a> {
<a name="l00144"></a>00144 <span class="keyword">public</span>:
<a name="l00145"></a>00145   <a class="code" href="class_m_t_rand53.html">MTRand53</a>() : <a class="code" href="class_m_t_rand__int32.html">MTRand_int32</a>() {}
<a name="l00146"></a>00146   <a class="code" href="class_m_t_rand53.html">MTRand53</a>(<span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> seed) : <a class="code" href="class_m_t_rand__int32.html">MTRand_int32</a>(seed) {}
<a name="l00147"></a>00147   <a class="code" href="class_m_t_rand53.html">MTRand53</a>(<span class="keyword">const</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span>* seed, <span class="keywordtype">int</span> size) : <a class="code" href="class_m_t_rand__int32.html">MTRand_int32</a>(seed, size) {}
<a name="l00148"></a>00148   ~<a class="code" href="class_m_t_rand53.html">MTRand53</a>() {}
<a name="l00149"></a>00149   <span class="keywordtype">double</span> operator()() {
<a name="l00150"></a>00150     <span class="keywordflow">return</span> (static_cast&lt;double&gt;(rand_int32() &gt;&gt; 5) * 67108864. + 
<a name="l00151"></a>00151       static_cast&lt;double&gt;(rand_int32() &gt;&gt; 6)) * (1. / 9007199254740992.); }
<a name="l00152"></a>00152 <span class="keyword">private</span>:
<a name="l00153"></a>00153   <a class="code" href="class_m_t_rand53.html">MTRand53</a>(<span class="keyword">const</span> <a class="code" href="class_m_t_rand53.html">MTRand53</a>&amp;); <span class="comment">// copy constructor not defined</span>
<a name="l00154"></a>00154   <span class="keywordtype">void</span> operator=(<span class="keyword">const</span> <a class="code" href="class_m_t_rand53.html">MTRand53</a>&amp;); <span class="comment">// assignment operator not defined</span>
<a name="l00155"></a>00155 };
<a name="l00156"></a>00156 
<a name="l00157"></a>00157 <span class="preprocessor">#endif // MTRAND_H</span>
</pre></div></div>
</div>
  <div id="nav-path" class="navpath">
    <ul>
      <li class="navelem"><b>mtrand.h</b>      </li>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Variables</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>


    <li class="footer">Generated on Thu Dec 15 2011 11:56:19 for nih by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.5.1 </li>
   </ul>
 </div>


</body>
</html>
